$OpenBSD: patch-src_sysdeps_bsd-net-open_c,v 1.8 2017/05/18 10:39:20 mpi Exp $
Index: src/sysdeps/bsd-net-open.c
--- src/sysdeps/bsd-net-open.c.orig
+++ src/sysdeps/bsd-net-open.c
@@ -50,7 +50,6 @@
 
 #include <netinet/ip_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 #include <netinet/tcp_seq.h>
 #include <netinet/tcp_fsm.h>
 #include <netinet/tcp_timer.h>
@@ -67,7 +66,7 @@ gkrellm_sys_inet_read_tcp_data(void)
    ActiveTCP tcp;
    gint	tcp_status;
    struct inpcbtable table;
-   struct inpcb inpcb, *head, *next;
+   struct inpcb inpcb, *next;
    struct tcpcb tcpcb;
    static struct nlist nl[] = {
 #define X_TCBTABLE    0
@@ -84,10 +83,8 @@ gkrellm_sys_inet_read_tcp_data(void)
 		sizeof(struct inpcbtable)) != sizeof(struct inpcbtable))
       return;
 
-	head = (struct inpcb *)
-		&((struct inpcbtable *)nl[X_TCBTABLE].n_value)->inpt_queue.cqh_first;
-   next = (struct inpcb *)table.inpt_queue.cqh_first;
-   while(next != NULL && next != head) {
+   next = TAILQ_FIRST(&table.inpt_queue);
+   while(next != NULL) {
       
       if (kvm_read(kvmd, (u_long)next,
 		   (char *)&inpcb, sizeof(inpcb)) == sizeof(inpcb) &&
@@ -103,7 +100,7 @@ gkrellm_sys_inet_read_tcp_data(void)
 	    gkrellm_inet_log_tcp_port_data(&tcp);
       }
 
-      next = (struct inpcb *)inpcb.inp_queue.cqe_next;
+      next = TAILQ_NEXT(&inpcb, inp_queue);
    }
 }
 #endif
